You can add a comment to your JavaScript code starting the comment with two slashes "//":

sum=a + b  //calculating the sum

#Title: JavaScript Guidelines
#Element: 297: Comments You can add a comment to your JavaScript ...
#Article: 173: JavaScript Guidelines